{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "3bb0e7c1-f1e1-4216-afdb-5114d1d6541f",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\Administrator\\anaconda3\\Lib\\site-packages\\keras\\src\\layers\\reshaping\\flatten.py:37: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.\n",
      "  super().__init__(**kwargs)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">Model: \"sequential_3\"</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1mModel: \"sequential_3\"\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓\n",
       "┃<span style=\"font-weight: bold\"> Layer (type)                         </span>┃<span style=\"font-weight: bold\"> Output Shape                </span>┃<span style=\"font-weight: bold\">         Param # </span>┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩\n",
       "│ flatten_3 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">Flatten</span>)                  │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">784</span>)                 │               <span style=\"color: #00af00; text-decoration-color: #00af00\">0</span> │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ dense_4 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">Dense</span>)                      │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">128</span>)                 │         <span style=\"color: #00af00; text-decoration-color: #00af00\">100,480</span> │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ dense_5 (<span style=\"color: #0087ff; text-decoration-color: #0087ff\">Dense</span>)                      │ (<span style=\"color: #00d7ff; text-decoration-color: #00d7ff\">None</span>, <span style=\"color: #00af00; text-decoration-color: #00af00\">10</span>)                  │           <span style=\"color: #00af00; text-decoration-color: #00af00\">1,290</span> │\n",
       "└──────────────────────────────────────┴─────────────────────────────┴─────────────────┘\n",
       "</pre>\n"
      ],
      "text/plain": [
       "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓\n",
       "┃\u001b[1m \u001b[0m\u001b[1mLayer (type)                        \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mOutput Shape               \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m        Param #\u001b[0m\u001b[1m \u001b[0m┃\n",
       "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩\n",
       "│ flatten_3 (\u001b[38;5;33mFlatten\u001b[0m)                  │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m784\u001b[0m)                 │               \u001b[38;5;34m0\u001b[0m │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ dense_4 (\u001b[38;5;33mDense\u001b[0m)                      │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m128\u001b[0m)                 │         \u001b[38;5;34m100,480\u001b[0m │\n",
       "├──────────────────────────────────────┼─────────────────────────────┼─────────────────┤\n",
       "│ dense_5 (\u001b[38;5;33mDense\u001b[0m)                      │ (\u001b[38;5;45mNone\u001b[0m, \u001b[38;5;34m10\u001b[0m)                  │           \u001b[38;5;34m1,290\u001b[0m │\n",
       "└──────────────────────────────────────┴─────────────────────────────┴─────────────────┘\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\"> Total params: </span><span style=\"color: #00af00; text-decoration-color: #00af00\">101,770</span> (397.54 KB)\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1m Total params: \u001b[0m\u001b[38;5;34m101,770\u001b[0m (397.54 KB)\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\"> Trainable params: </span><span style=\"color: #00af00; text-decoration-color: #00af00\">101,770</span> (397.54 KB)\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1m Trainable params: \u001b[0m\u001b[38;5;34m101,770\u001b[0m (397.54 KB)\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\"> Non-trainable params: </span><span style=\"color: #00af00; text-decoration-color: #00af00\">0</span> (0.00 B)\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1m Non-trainable params: \u001b[0m\u001b[38;5;34m0\u001b[0m (0.00 B)\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "mnist = tf.keras.datasets.mnist\n",
    "(x_train,y_train),(x_test,y_test)=mnist.load_data()\n",
    "x_train,x_test=x_train/255.0,x_test/255.0\n",
    "model=tf.keras.models.Sequential()\n",
    "model.add(tf.keras.layers.Flatten(input_shape=(28,28)))\n",
    "model.add(tf.keras.layers.Dense(128,activation='relu'))\n",
    "model.add(tf.keras.layers.Dense(10,activation='softmax'))\n",
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "6c4b2f29-9184-48d6-8ff3-7147ed1e609d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1/5\n",
      "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m4s\u001b[0m 2ms/step - loss: 0.0380 - sparse_categorical_accuracy: 0.9880\n",
      "Epoch 2/5\n",
      "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m3s\u001b[0m 2ms/step - loss: 0.0288 - sparse_categorical_accuracy: 0.9909\n",
      "Epoch 3/5\n",
      "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m3s\u001b[0m 2ms/step - loss: 0.0221 - sparse_categorical_accuracy: 0.9931\n",
      "Epoch 4/5\n",
      "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m3s\u001b[0m 2ms/step - loss: 0.0189 - sparse_categorical_accuracy: 0.9938\n",
      "Epoch 5/5\n",
      "\u001b[1m1875/1875\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m3s\u001b[0m 2ms/step - loss: 0.0155 - sparse_categorical_accuracy: 0.9955\n",
      "313/313 - 1s - 2ms/step - loss: 0.0856 - sparse_categorical_accuracy: 0.9770\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[0.08560516685247421, 0.9769999980926514]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.compile(loss='sparse_categorical_crossentropy',\n",
    "             optimizer='adam',metrics=['sparse_categorical_accuracy'])\n",
    "model.fit(x_train,y_train,batch_size=32,epochs=5)\n",
    "model.evaluate(x_test,y_test,batch_size=32,verbose=2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "a4ead777-529f-4293-b781-cd98fe5c535b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 57ms/step\n",
      "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 31ms/step\n",
      "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 30ms/step\n",
      "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 30ms/step\n",
      "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 31ms/step\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgQAAACQCAYAAAB3anPqAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vb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JyDHPjmpgX18XcuC7mxhjF2iAgIiKi0sF1tm8jIiKiEsMGAREREbFBQERERGwQEBERERzYmMjWiU3kHCPmdDI3xcPZ3DAvxYPfGdfF74xrsjcv7CEgIiIiNgiIiIiIDQIiIiICGwREREQENgiIiIgId+D4YyIiotKkd+/eKg4ICLAaz507947W6U5gDwERERGxQUBEREQOnHbIDSOKBzdZcV3cZMU18TvjukrzdyYoKEjFW7ZsUXG9evWsxmlpaXemYgbgxkRERERkNzYIiIiIiKsMyHHu7rfakQMHDlRxaGio1ftHjx6t4lOnTqnYz89PxXFxcSq+ceOGilNSUlS8YcMGFevddZmZmfZWnahUq169uorDw8NV/Nlnn6l406ZNKp45c6aKU1NTVZybm2tR7tmzZw2tZ2kRERGh4sTERBVXqFBBxb169VJxaRomKAr2EBAREREbBERERFSOVxl88MEHKta7vdevX6/iqKgoFevd2EYqjTOm/f39VXz58uVC79frZ8T7BYCDBw+quH///jZ/54zSPGPalsjISBUvXbpUxffee6+Kr127pmI9v/r34ccffyymGhauNH5nnNG9e3cVv/vuuyoODg4ucpknT560+HPLli1VnJ6eXuRyS8N3Rh8O+Oqrr1T80EMPqVj/nPUhz9KKqwyIiIjIbmwQEBERUflaZdClSxcV68MEeneKPuu0cuXKKtZn6JZ3zZo1K+kqoEmTJirWNxShgoYPH67iBQsWqNjDw0PFmzdvVrE+k/r8+fMq5mqOO2fWrFkqHj9+vIqNGnKrU6eOxZ/nzJmj4kGDBhnyDFfVsGFDFevDBLrly5ffodq4FvYQEBERERsEREREVM6GDKZMmVLoPVu3blUxhwms279/v0P3jxw5UsXLli1z6LXPPfecivVNWb7++msV79u3z6Eyy4OePXuqeN68eSqeP3++ivfu3aviSZMmqTgsLEzF+rDCK6+8ouIdO3ZYvX748GFnql3u3HXXXSqePHmyiseMGVPoa69evapifdMuPa9r1qxRsZ6zKlWqWJRVnobdXnjhBRVfunRJxSNGjFDx8ePH72idXAV7CIiIiIgNAiIiImKDgIiIiFAO5hDoSw0ffPDBQu//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JKSklSsd1vaoudL74rWh51sDeMVl5L4ztSrV0/F+oobnb4xDgB8+umnKtaHLvXuZZ2+P72+WY1e18OHD6tYXyFUXMNmjipt3xl9ZYi+mm3BggUq1lfXjBw5UsV6Tr/99lsV6ysIWrRooeLFixerWD+3QqcPuwKA2Wz+5zdgJw4ZEBERkd3YICAiIiI2CIiIiMiF5xBUqFBBxfrZ1q1bt7Z6v7685uWXXy6+ihmsJMZDdfp8An0nLP2c8Nvvc5ReP0ffr77kVN9lLzc3t8j1sVdpGw+1RT8PXl92WLVqVRXfuHGj0HL0pW36EkRbY+LFpSS+M/qSQH1Zma1/j4wUGxurYn1se//+/cX+bEeVle9MWcM5BERERGQ3NgiIiIjIdQ830nfD++abb1Rsq4tOPwSC7PfHH3+oODo6WsV6dzIANG/eXMX6zmlGdZm+9957KtaXQuq5vxPDBGWRfvCK3s384YcfqjgmJkbFmZmZKm7YsKGK9aV3p0+fNrqaLk1fUvjss8+qWO/C79mzp11l7d69W8VvvPGGivXDkHT2LLsmMgJ7CIiIiIgNAiIiInLhVQY6/Xx2fSb8U089peKOHTuqWN81ytWV9CoDsq0szpgODAxU8dtvv61ivRtcP6xI3zFPH8rRV3zc6S5tfmdcV1n8zpQFXGVAREREdmODgIiIiErHkEFZxu5P18XuT9fE74zr4nfGNXHIgIiIiOzGBgERERGxQUBERERsEBARERHYICAiIiKwQUBERERgg4CIiIjABgERERHBgY2JiIiIqOxiDwERERGxQUBERERsEBARERHYICAiIiKwQUBERERgg4CIiIjABgERERGBDQIiIiICGwREREQE4P8BdeZnRu3zGsAAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 5 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "for i in range(5):\n",
    "    t=np.random.randint(1,10000)\n",
    "    x=tf.reshape(x_test[t],(1,28,28))\n",
    "    y_pred=np.argmax(model.predict(x),axis=1)\n",
    "    plt.subplot(1,5,i+1)\n",
    "    plt.rcParams['font.sans-serif']=['SimHei']\n",
    "    plt.axis(\"off\")\n",
    "    plt.imshow(x_test[t],cmap='gray')\n",
    "    title=\"标签值: \"+str(y_test[t])+\"\\n预测值：\"+str(y_pred[0])\n",
    "    plt.title(title)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c470787c-f909-40aa-93dd-4e12f1dfbd16",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
